home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / snip9_91.arc / NDPCHECK.ASM < prev    next >
Assembly Source File  |  1991-09-17  |  1KB  |  42 lines

  1. ;
  2. ;  FUNCTION:  ndp_check
  3. ;
  4. ;  Require MASM 5.1 or later, or equivalent
  5. ;
  6.  
  7.         page    55, 132
  8.  
  9. %       .MODEL  memodel,C               ;Add model support via
  10.                                         ;command line macros, e.g.
  11.                                         ;MASM /Mx /Dmemodel=LARGE
  12.  
  13.         .CODE
  14.  
  15. control dw      0
  16.  
  17. ;---------------------------------------------------------------
  18. ;
  19. ; Check for an NDP.
  20. ;
  21. ;  Returns 0 if no coprocessor
  22. ;  Returns 1 if coprocessor present
  23.  
  24.     PUBLIC    ndp_check
  25.  
  26. ndp_check       PROC    USES BX
  27.         xor     BX,BX                    ; set up zero return
  28.         fninit                           ; try to initialize the NDP
  29.         mov     byte ptr control+1,0     ; clear memory byte
  30.         fnstcw  control                  ; put control word in memory
  31.         mov     AH,byte ptr control+1    ; if AH is 03h, you got
  32.         cmp     AH,03h                   ;   an NDP on board !!
  33.         jne     SHORT NDPbye
  34.         inc     BX
  35. NDPbye:
  36.         mov     AX,BX
  37.         ret
  38.  
  39. ndp_check       ENDP
  40.  
  41.         end
  42.